package com.hbnu.net;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author kittychen
 * @since 2025-10-22 11:18
 */
public class InetAddressDemo {
    public static void main(String[] args) {
        try {
            InetAddress inetAddress = InetAddress.getLocalHost();
            System.out.println(inetAddress);
            System.out.println(inetAddress.getHostAddress());
            System.out.println(inetAddress.getHostName());
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
    }
}
